﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SWSoft.Framework;

namespace MDHIS
{
    public partial class FormYIBAOXZ : Form
    {
        public FormYIBAOXZ()
        {
            InitializeComponent();
        }

        private void FormYIBAOXZ_Load(object sender, EventArgs e)
        {
            var table = DBVisitor.ExecuteModels("SELECT ylbxid,ylbxmc,hzsrm3 FROM yb_bxlbxx ORDER BY ylbxid asc");
            foreach (var item in table)
            {
                var viewitem = new ListViewItem(item["YLBXID"].ToString());
                viewitem.SubItems.Add(item["YLBXMC"].ToString());
                viewitem.SubItems.Add(item["HZSRM3"].ToString());
                viewitem.Tag = item;
                listView1.Items.Add(viewitem);
            }

            listView1.Select();
        }
        
        private void listView1_KeyPress(object sender, KeyPressEventArgs e)
        {

            if (e.KeyChar == (char)Keys.Enter)
            {
                new FormDUKA(listView1.SelectedItems[0].Tag as Entry).ShowDialog();
                this.Close();
            }
        }
    }
}
